package com.xhl.mybatis.service.impl;

import com.alibaba.fastjson.JSON;
import com.xhl.mybatis.dao.UserInfoDAO;
import com.xhl.mybatis.dto.UserDTO;
import com.xhl.mybatis.entity.UserInfo;
import com.xhl.mybatis.service.IUserInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author CazCen
 * @Date 2021/12/15 19:37
 */
@Service
public class UserInfoImpl implements IUserInfo {

    @Resource
    UserInfoDAO userInfoDAO;

    @Override
    public String getUserInfo(UserDTO userDTO) {

        List<UserInfo> userInfo = userInfoDAO.getUserInfo(userDTO);

        String s = JSON.toJSONString(userInfo);

        UserDTO userDTO1 = new UserDTO();
        userDTO1.setName("cazcen");
        userDTO1.setPwd("xhl1111");
        userInfoDAO.insertUserInfo(userDTO1);

        return s;
    }
}
